package com.firmboy.spring_mybatis_durid.demo.web;

import com.firmboy.spring_mybatis_durid.demo.bean.Demo;
import com.firmboy.spring_mybatis_durid.demo.mapper.DemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author firmboy
 * @create 2018-05-27 下午5:34
 **/
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private DemoMapper demoMapper;


    @RequestMapping("/{id}")
    public Demo getDemo(@PathVariable("id") String id){

        Demo demo = demoMapper.selectByPrimaryKey(id);
        return demo;
    }
}
